using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace FBPChaos
{
    public class MainMenu : ShowText
    {
        MenuPosition startPosition;
        string spacing;
        bool active;

        public enum MenuPosition
        {
            Normal = 1,
            Middle = 2,
            DoubleList = 3
        };

        public MainMenu()
        {
            active = false;
        }

        public void newGame()
        {
            //query number of wizards (2 to 8)
            //query number of players (1 to wizards)
            //query difficulty (1 to 5)
            startPosition = MenuPosition.Middle;
            spacing = "none";
            addText("Welcome to FBPChaos");
            active = true;
        }

        public void showWizardsQuery(int maxWizards)
        {
            clear();
            startPosition = MenuPosition.Normal;
            spacing = "normal";
            addText("Enter number of wizards (2-" + maxWizards.ToString() + ")");
            active = true;
        }

        public void showSpellList(string[] spells)
        {
            clear();
            active = true;
            startPosition = MenuPosition.DoubleList;
            //2 columns
            for (int counter = 0; counter < spells.Length; counter++)
            {
                addText("Spell " + (counter +1).ToString() + ": " + InputHelper.numberToLetter(counter) + ". " + spells[counter]);
            }
        }

        public void showPlayersQuery(int numberOfWizards)
        {
            clear();
            startPosition = MenuPosition.Normal;
            spacing = "normal";
            addText("Enter number of human players (1-" + numberOfWizards.ToString() +")");
            active = true;
        }

        public void showDifficultyQuery(int maxDifficulty)
        {
            clear();
            startPosition = MenuPosition.Normal;
            spacing = "normal";
            addText("Enter difficulty (1-" + maxDifficulty.ToString() + ")");
            active = true;
        }

        public void showPlayerOptions()
        {
            clear();
            startPosition = MenuPosition.Normal;
            spacing = "normal";
            addText("Choose a menu option");
            addText("1. Choose Spell");
            addText("2. Return to Game");
            active = true;
        }

        public void showWinner(int winningWizard)
        {
            clear();
            startPosition = MenuPosition.Normal;
            spacing = "normal";
            addText("The Winner is Player " + winningWizard.ToString());
            active = true;
        }

        public void hideMenu()
        {
            active = false;
        }

        public string Spacing
        {

            get { return spacing; }
        }

        public MenuPosition StartPosition
        {
            get { return startPosition; }
        }

        public bool Active
        {
            get { return active; }
        }
    }
}
